//
//  YTKApi.h
//  YTKNetworkEncapsulation
//
//  Created by tianXin on 16/9/1.
//
//

#import <YTKNetwork/YTKNetwork.h>
#import "HRBaseRequstDataModel.h"
@interface YTKApi : YTKRequest
{
    id _para;
    NSString *_url;
    YTKRequestMethod _method;
}
@property (nonatomic, assign)    NSInteger cacheTime;

@property(nonatomic,assign)  YTKRequestSerializerType requestSerializerType;
+ (YTKApi *)apiPostWithUrl:(NSString *)url para:(id)para;                               //传递任意类型的参数
+ (YTKApi *)apiPostWithUrl:(NSString *)url paraDictionary:(NSDictionary *)para;         //生成api（post调用）
+ (YTKApi *)apiPostWithUrl:(NSString *)url parameter:(HRBaseRequstDataModel *)para;                 //生成api（post调用,id改为基类model）
+ (YTKApi *)apiGetWithUrl:(NSString *)url parameter:(HRBaseRequstDataModel *)para;                  //生成api（get调用,id改为基类model）
- (YTKApi *)appendUrlParameter:(NSNumber *)para;                                        //给url后附带整形的参数

+ (YTKApi *)apiPutWithUrl:(NSString *)url parameter:(HRBaseRequstDataModel *)para;                 //生成api（put调用,id改为基类model）

+ (YTKApi *)apiPutWithUrl:(NSString *)url para:(id)para;


+ (YTKApi *)apiGetWithUrl:(NSString *)url para:(id)para;

- (YTKApi *)appendUrlStringParameter:(NSString *)para;

+ (YTKApi *)apiDeleteWithUrl:(NSString *)url para:(id)para;

- (void)getSuccessToken:(void(^)())isGetToken;

@property(nonatomic,assign) BOOL foceNoTocken;
@property(nonatomic,strong) NSString *apiName;

//执行网络请求
- (void)startWithSuccess:(void (^)(YTKBaseRequest *request))success;
/**
 typedef NS_ENUM(NSInteger , YTKRequestSerializerType) {
     YTKRequestSerializerTypeHTTP = 0,
     YTKRequestSerializerTypeJSON,
 */
- (void)setRequestSerializerType:(YTKRequestSerializerType)requestSerializerType;

- (void)setCatchTime:(NSInteger)catchSeconds;                                           //设置缓存时间(秒)，如果catchTime==0,则不缓存

- (NSString *)description;

@end
